/////////////////////////////////////////////////////////////////////////////
// Name:        prefs.cpp
// Purpose:     
// Author:      Stephen Whittle
// Modified by: 
// Created:     09/06/2009 10:22:47
// RCS-ID:      
// Copyright:   
// Licence:     
/////////////////////////////////////////////////////////////////////////////

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif 

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
////@end includes

#include "prefs.cpp"

////@begin XPM images
////@end XPM images


/*
 * Preferences type definition
 */

IMPLEMENT_DYNAMIC_CLASS( Preferences, wxDialog )


/*
 * Preferences event table definition
 */

BEGIN_EVENT_TABLE( Preferences, wxDialog )

////@begin Preferences event table entries
////@end Preferences event table entries

END_EVENT_TABLE()


/*
 * Preferences constructors
 */

Preferences::Preferences()
{
    Init();
}

Preferences::Preferences( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
    Init();
    Create(parent, id, caption, pos, size, style);
}


/*
 * Preferences creator
 */

bool Preferences::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin Preferences creation
    SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
    wxDialog::Create( parent, id, caption, pos, size, style );

    CreateControls();
    if (GetSizer())
    {
        GetSizer()->SetSizeHints(this);
    }
    Centre();
////@end Preferences creation
    return true;
}


/*
 * Preferences destructor
 */

Preferences::~Preferences()
{
////@begin Preferences destruction
////@end Preferences destruction
}


/*
 * Member initialisation
 */

void Preferences::Init()
{
////@begin Preferences member initialisation
////@end Preferences member initialisation
}


/*
 * Control creation for Preferences
 */

void Preferences::CreateControls()
{    
////@begin Preferences content construction
    Preferences* itemDialog1 = this;

    wxFlexGridSizer* itemFlexGridSizer2 = new wxFlexGridSizer(4, 1, 0, 0);
    itemFlexGridSizer2->AddGrowableCol(0);
    itemDialog1->SetSizer(itemFlexGridSizer2);

    wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Colour Settings"));
    wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL);
    itemFlexGridSizer2->Add(itemStaticBoxSizer3, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxFlexGridSizer* itemFlexGridSizer4 = new wxFlexGridSizer(0, 2, 0, 0);
    itemFlexGridSizer4->AddGrowableCol(0);
    itemFlexGridSizer4->AddGrowableCol(1);
    itemStaticBoxSizer3->Add(itemFlexGridSizer4, 0, wxGROW|wxALL, 5);

    wxCheckBox* itemCheckBox5 = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Use Custom Colours"), wxDefaultPosition, wxDefaultSize, 0 );
    itemCheckBox5->SetValue(false);
    itemFlexGridSizer4->Add(itemCheckBox5, 0, wxGROW|wxGROW|wxALL, 5);

    wxButton* itemButton6 = new wxButton( itemDialog1, ID_BUTTON9, _("Select Custom Colours"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer4->Add(itemButton6, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxFlexGridSizer* itemFlexGridSizer7 = new wxFlexGridSizer(0, 2, 0, 0);
    itemFlexGridSizer4->Add(itemFlexGridSizer7, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText8 = new wxStaticText( itemDialog1, wxID_STATIC, _("Foreground (Default text) colour"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer7->Add(itemStaticText8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxColourPickerCtrl* itemColourPickerCtrl9 = new wxColourPickerCtrl( itemDialog1, ID_COLOURPICKERCTRL15, wxColour(), wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE );
    itemFlexGridSizer7->Add(itemColourPickerCtrl9, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxFlexGridSizer* itemFlexGridSizer10 = new wxFlexGridSizer(0, 2, 0, 0);
    itemFlexGridSizer4->Add(itemFlexGridSizer10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText11 = new wxStaticText( itemDialog1, wxID_STATIC, _("Background colour"), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer10->Add(itemStaticText11, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxColourPickerCtrl* itemColourPickerCtrl12 = new wxColourPickerCtrl( itemDialog1, ID_COLOURPICKERCTRL, wxColour(), wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE );
    itemFlexGridSizer10->Add(itemColourPickerCtrl12, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticBox* itemStaticBoxSizer13Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Terminal Settings"));
    wxStaticBoxSizer* itemStaticBoxSizer13 = new wxStaticBoxSizer(itemStaticBoxSizer13Static, wxHORIZONTAL);
    itemFlexGridSizer2->Add(itemStaticBoxSizer13, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxFlexGridSizer* itemFlexGridSizer14 = new wxFlexGridSizer(3, 2, 0, 0);
    itemStaticBoxSizer13->Add(itemFlexGridSizer14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxCheckBox* itemCheckBox15 = new wxCheckBox( itemDialog1, ID_CHECKBOX2, _("Carriage return repeats last command"), wxDefaultPosition, wxDefaultSize, 0 );
    itemCheckBox15->SetValue(false);
    itemFlexGridSizer14->Add(itemCheckBox15, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxCheckBox* itemCheckBox16 = new wxCheckBox( itemDialog1, ID_CHECKBOX3, _("Echo locally"), wxDefaultPosition, wxDefaultSize, 0 );
    itemCheckBox16->SetValue(false);
    itemFlexGridSizer14->Add(itemCheckBox16, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxCheckBox* itemCheckBox17 = new wxCheckBox( itemDialog1, ID_CHECKBOX4, _("Allow multiple commands on one line"), wxDefaultPosition, wxDefaultSize, 0 );
    itemCheckBox17->SetValue(false);
    itemFlexGridSizer14->Add(itemCheckBox17, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer14->Add(itemBoxSizer18, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText19 = new wxStaticText( itemDialog1, wxID_STATIC, _("Command seperator:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer18->Add(itemStaticText19, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxTextCtrl* itemTextCtrl20 = new wxTextCtrl( itemDialog1, ID_TEXTCTRL11, wxEmptyString, wxDefaultPosition, wxSize(20, -1), 0 );
    itemTextCtrl20->SetMaxLength(1);
    itemBoxSizer18->Add(itemTextCtrl20, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer21 = new wxBoxSizer(wxHORIZONTAL);
    itemFlexGridSizer14->Add(itemBoxSizer21, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 0);

    wxStaticText* itemStaticText22 = new wxStaticText( itemDialog1, wxID_STATIC, _("Wixtin command character:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer21->Add(itemStaticText22, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxTextCtrl* itemTextCtrl23 = new wxTextCtrl( itemDialog1, ID_TEXTCTRL12, wxEmptyString, wxDefaultPosition, wxSize(20, -1), 0 );
    itemTextCtrl23->SetMaxLength(1);
    itemBoxSizer21->Add(itemTextCtrl23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticBox* itemStaticBoxSizer24Static = new wxStaticBox(itemDialog1, wxID_ANY, _("General Settings"));
    wxStaticBoxSizer* itemStaticBoxSizer24 = new wxStaticBoxSizer(itemStaticBoxSizer24Static, wxHORIZONTAL);
    itemFlexGridSizer2->Add(itemStaticBoxSizer24, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxFlexGridSizer* itemFlexGridSizer25 = new wxFlexGridSizer(4, 2, 0, 0);
    itemFlexGridSizer25->AddGrowableCol(1);
    itemFlexGridSizer25->AddGrowableCol(2);
    itemStaticBoxSizer24->Add(itemFlexGridSizer25, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxRadioButton* itemRadioButton26 = new wxRadioButton( itemDialog1, ID_RADIOBUTTON1, _("Global configuration"), wxDefaultPosition, wxDefaultSize, 0 );
    itemRadioButton26->SetValue(true);
    itemRadioButton26->Enable(false);
    itemFlexGridSizer25->Add(itemRadioButton26, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxCheckBox* itemCheckBox27 = new wxCheckBox( itemDialog1, ID_CHECKBOX5, _("Save QuickConnect settings"), wxDefaultPosition, wxDefaultSize, 0 );
    itemCheckBox27->SetValue(false);
    itemFlexGridSizer25->Add(itemCheckBox27, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxRadioButton* itemRadioButton28 = new wxRadioButton( itemDialog1, ID_RADIOBUTTON, _("Per-user configuration"), wxDefaultPosition, wxDefaultSize, 0 );
    itemRadioButton28->SetValue(false);
    itemRadioButton28->Enable(false);
    itemFlexGridSizer25->Add(itemRadioButton28, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStdDialogButtonSizer* itemStdDialogButtonSizer29 = new wxStdDialogButtonSizer;

    itemFlexGridSizer2->Add(itemStdDialogButtonSizer29, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
    wxButton* itemButton30 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStdDialogButtonSizer29->AddButton(itemButton30);

    wxButton* itemButton31 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStdDialogButtonSizer29->AddButton(itemButton31);

    itemStdDialogButtonSizer29->Realize();

////@end Preferences content construction
}


/*
 * Should we show tooltips?
 */

bool Preferences::ShowToolTips()
{
    return true;
}

/*
 * Get bitmap resources
 */

wxBitmap Preferences::GetBitmapResource( const wxString& name )
{
    // Bitmap retrieval
////@begin Preferences bitmap retrieval
    wxUnusedVar(name);
    return wxNullBitmap;
////@end Preferences bitmap retrieval
}

/*
 * Get icon resources
 */

wxIcon Preferences::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin Preferences icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end Preferences icon retrieval
/*!
 * Preferences class declaration
 */

class Preferences: public wxDialog
{    
    DECLARE_DYNAMIC_CLASS( Preferences )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    Preferences();
    Preferences( wxWindow* parent, wxWindowID id = SYMBOL_PREFERENCES_IDNAME, const wxString& caption = SYMBOL_PREFERENCES_TITLE, const wxPoint& pos = SYMBOL_PREFERENCES_POSITION, const wxSize& size = SYMBOL_PREFERENCES_SIZE, long style = SYMBOL_PREFERENCES_STYLE );

    /// Creation
    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_PREFERENCES_IDNAME, const wxString& caption = SYMBOL_PREFERENCES_TITLE, const wxPoint& pos = SYMBOL_PREFERENCES_POSITION, const wxSize& size = SYMBOL_PREFERENCES_SIZE, long style = SYMBOL_PREFERENCES_STYLE );

    /// Destructor
    ~Preferences();

    /// Initialises member variables
    void Init();

    /// Creates the controls and sizers
    void CreateControls();

////@begin Preferences event handler declarations

////@end Preferences event handler declarations

////@begin Preferences member function declarations

    /// Retrieves bitmap resources
    wxBitmap GetBitmapResource( const wxString& name );

    /// Retrieves icon resources
    wxIcon GetIconResource( const wxString& name );
////@end Preferences member function declarations

    /// Should we show tooltips?
    static bool ShowToolTips();

////@begin Preferences member variables
////@end Preferences member variables
};

}
